package com.jinbiao.beans;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.plaf.synth.SynthSliderUI;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.Log4JLogger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;

import com.jinbiao.entity.Apple;
import com.jinbiao.entity.Person;

/**
 * 启动类
 * @author EX_WLJR_ZHUANGJB
 *
 */
public class AppStart {

	public static void main(String[] args) {
		
		//根据路径进行加载配置文件 
		ApplicationContext content =  new ClassPathXmlApplicationContext("application/bean.xml");
		
		//根据文件file进行配置文件的加载
		// ApplicationContext content1 = new FileSystemXmlApplicationContext("application/bean.xml");
		 
		 //遇到多个配置文件进行加载 
		// ApplicationContext content2 = new ClassPathXmlApplicationContext(new String[] {"bean.xml","bean1.xml"});
		 
		//获取Apple
		Apple app =  (Apple) content.getBean("app");
		Person p =  (Person) content.getBean("person");
		System.out.println(">>>>>>>"+ new SimpleDateFormat("yyyy-MM").format(new Date())+"[]"+"<<<<<<<<"+app.getName());
		System.out.println(">>>>>>>"+ new SimpleDateFormat("yyyy-MM").format(new Date())+"[]"+"<<<<<<<<"+p.toString());
	}
	
	
	
}
	
		
